0e939d2750fced173ca73af90839fe0908996c7f,org.spoofax.jsglr/src/org/spoofax/jsglr/client/SGLR.java,SGLR,reduceAllPaths,#Production#PooledPathList#,1018

Before Change



            if(!prod.isCompletionProduction() || isReductionOverCursorLocation(path)) {
                if(checkMaxRecoverCount(prod, path)) {
                    if(!prod.isRecoverProduction())
                        reducer(st0, next, prod, kids, path);
                    else
                        reducerRecoverProduction(st0, next, prod, kids, path);

After Change


        }
    }

    private void reduceAllPaths(Production prod, PooledPathList paths) throws InterruptedException {

        for(int i = 0; i < paths.size(); i++) {
            final Path path = paths.get(i);
            final AbstractParseNode[] kids = path.getParseNodes();
            final Frame st0 = path.getEnd();
            final State next = parseTable.go(st0.state, prod.label);
            logReductionPath(prod, path, st0, next);

            if(PARSE_TIME_LAYOUT_FITER && !layoutFilter.hasValidLayout(prod.label, kids)) {
                layoutFiltering++;
                continue;
            } else if(PARSE_TIME_LAYOUT_FITER)
                layoutFiltering += layoutFilter.getDisambiguationCount();

            if(ENFORCE_NEWLINE_FILTER && parseTable.getLabel(prod.label).getAttributes().isNewlineEnforced()) {
                boolean hasNewline = false;
                for(int j = kids.length - 1; j >= 0; j--) {
                    int status = kids[j].getLayoutStatus();

                    if(status == AbstractParseNode.NEWLINE_LAYOUT) {
                        hasNewline = true;
                        break;
                    }
                    if(status == AbstractParseNode.OTHER_LAYOUT) {
                        hasNewline = false;
                        break;
                    }
                }

                if(!hasNewline) {
                    enforcedNewlineSkip++;
                    continue;
                }
            }

           if(checkMaxRecoverCount(prod, path))
                if(isNewCompletionMode) {
                    if(prod.isRecoverProduction() && !prod.isNewCompletionProduction())
                        reducerRecoverProduction(st0, next, prod, kids, path);
                    else
                        reducer(st0, next, prod, kids, path);